package com.dtsheep.elasticsearch.es.client;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;

/**
 * ElasticsearchClientTest
 *
 * <p>
 *      创建 es客户端工具类
 * </p>
 *
 * @author chuanbai
 * @date 2024/5/24
 */

public class ElasticsearchClientUtil {

    /**
     * 获取es客户端连接
     */
    public static RestHighLevelClient getEsClient(){
        return  new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost",9200))

        );
    }
}
